package com.health.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.health.common.enums.ProductStatusEnum;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.health.common.annotation.Excel;
import com.health.common.core.domain.BaseEntity;

import javax.persistence.Transient;

/**
 * 商品对象 mall_product
 *
 * @author ruoyi
 * @date 2025-10-27
 */
public class MallProduct extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 商品ID */
    private Long productId;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String productName;

    /** 分类ID */
    @Excel(name = "分类ID")
    private Long categoryId;

    /** 商品编码 */
    @Excel(name = "商品编码")
    private String productCode;

    /** 主图 */
    @Excel(name = "主图")
    private String mainImage;

    /** 子图(JSON数组) */
    @Excel(name = "子图(JSON数组)")
    private String subImages;

    /** 商品描述 */
    @Excel(name = "商品描述")
    private String description;

    /** 原价 */
    @Excel(name = "原价")
    private BigDecimal originalPrice;

    /** 现价 */
    @Excel(name = "现价")
    private BigDecimal currentPrice;

    /** 库存 */
    @Excel(name = "库存")
    private Long stock;

    /** 销量 */
    @Excel(name = "销量")
    private Long sales;

    /** 标签 */
    @Excel(name = "标签")
    private String tags;

    /** 是否热销: 1-是, 0-否 */
    @Excel(name = "是否热销: 1-是, 0-否")
    private Long isHot;

    /** 是否新品: 1-是, 0-否 */
    @Excel(name = "是否新品: 1-是, 0-否")
    private Long isNew;

    /** 是否秒杀: 1-是, 0-否 */
    @Excel(name = "是否秒杀: 1-是, 0-否")
    private Long isSeckill;

    /** 秒杀价 */
    @Excel(name = "秒杀价")
    private BigDecimal seckillPrice;

    /** 秒杀库存 */
    @Excel(name = "秒杀库存")
    private Long seckillStock;

    /** 秒杀开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "秒杀开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date seckillStartTime;

    /** 秒杀结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "秒杀结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date seckillEndTime;

    /** 状态: 0-上架, 1-下架 ，2-待审核，3-未通过*/
    @Excel(name = "状态: 0-上架, 1-下架，2-待审核，3-未通过")
    private String status;

    @Transient
    private String statusDesc;

    public String getStatusDesc() {
        return ProductStatusEnum.getDescByCode(this.status);
    }

    public void setStatusDesc(String statusDesc) {
        this.statusDesc = statusDesc;
    }

    public void setProductId(Long productId)
    {
        this.productId = productId;
    }

    public Long getProductId()
    {
        return productId;
    }

    public void setProductName(String productName)
    {
        this.productName = productName;
    }

    public String getProductName()
    {
        return productName;
    }

    public void setCategoryId(Long categoryId)
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId()
    {
        return categoryId;
    }

    public void setMainImage(String mainImage)
    {
        this.mainImage = mainImage;
    }

    public String getMainImage()
    {
        return mainImage;
    }

    public void setSubImages(String subImages)
    {
        this.subImages = subImages;
    }

    public String getSubImages()
    {
        return subImages;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public String getDescription()
    {
        return description;
    }

    public void setOriginalPrice(BigDecimal originalPrice)
    {
        this.originalPrice = originalPrice;
    }

    public BigDecimal getOriginalPrice()
    {
        return originalPrice;
    }

    public void setCurrentPrice(BigDecimal currentPrice)
    {
        this.currentPrice = currentPrice;
    }

    public BigDecimal getCurrentPrice()
    {
        return currentPrice;
    }

    public void setStock(Long stock)
    {
        this.stock = stock;
    }

    public Long getStock()
    {
        return stock;
    }

    public void setSales(Long sales)
    {
        this.sales = sales;
    }

    public Long getSales()
    {
        return sales;
    }

    public void setTags(String tags)
    {
        this.tags = tags;
    }

    public String getTags()
    {
        return tags;
    }

    public void setIsHot(Long isHot)
    {
        this.isHot = isHot;
    }

    public Long getIsHot()
    {
        return isHot;
    }

    public void setIsNew(Long isNew)
    {
        this.isNew = isNew;
    }

    public Long getIsNew()
    {
        return isNew;
    }

    public void setIsSeckill(Long isSeckill)
    {
        this.isSeckill = isSeckill;
    }

    public Long getIsSeckill()
    {
        return isSeckill;
    }

    public void setSeckillPrice(BigDecimal seckillPrice)
    {
        this.seckillPrice = seckillPrice;
    }

    public BigDecimal getSeckillPrice()
    {
        return seckillPrice;
    }

    public void setSeckillStock(Long seckillStock)
    {
        this.seckillStock = seckillStock;
    }

    public Long getSeckillStock()
    {
        return seckillStock;
    }

    public void setSeckillStartTime(Date seckillStartTime)
    {
        this.seckillStartTime = seckillStartTime;
    }

    public Date getSeckillStartTime()
    {
        return seckillStartTime;
    }

    public void setSeckillEndTime(Date seckillEndTime)
    {
        this.seckillEndTime = seckillEndTime;
    }

    public Date getSeckillEndTime()
    {
        return seckillEndTime;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("productId", getProductId())
                .append("productName", getProductName())
                .append("categoryId", getCategoryId())
                .append("mainImage", getMainImage())
                .append("subImages", getSubImages())
                .append("description", getDescription())
                .append("originalPrice", getOriginalPrice())
                .append("currentPrice", getCurrentPrice())
                .append("stock", getStock())
                .append("sales", getSales())
                .append("tags", getTags())
                .append("isHot", getIsHot())
                .append("isNew", getIsNew())
                .append("isSeckill", getIsSeckill())
                .append("seckillPrice", getSeckillPrice())
                .append("seckillStock", getSeckillStock())
                .append("seckillStartTime", getSeckillStartTime())
                .append("seckillEndTime", getSeckillEndTime())
                .append("status", getStatus())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }
}
